import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
    state: () => ({
        user: {
            id: 0,
            name: '',
            email: '',
            password: '',
            role: '',
            avatar: '',
            createdAt: '',
            updatedAt: '',
        },
        token: '',
    }),
    actions: {
        setUser(user: any) {
            this.user = user
            console.log("user",this.user);
            
        },
        setToken(token: string) {
            this.token = token
            console.log("token",this.token);
        }
    }
})